import type {
  CategoryTwoParams,
  CategoryTwoResponse,
  DayReportParams,
  DayReportResponse,
  FujiafeiParams,
  FujiafeiResponse,
  GoodsUnitParams,
  GoodsUnitResponse,
  UnitDataResponse,
} from './types';
import { post, upload } from '@/utils/request';

export const getDayReport = (data: DayReportParams) => post<DayReportResponse>('/syapi/category/lists', { data });

// 获取二级分类
export const getCategoryTwo = (data: CategoryTwoParams) => post<CategoryTwoResponse>('/syapi/category/categorytwo', { data });

// 获取商品单位
export const getGoodsUnit = (data: GoodsUnitParams) => post<GoodsUnitResponse>('/syapi/Goods/extendUnitData', { data });

// 获取商品单位
export const getUnitData = (data: any) => post<UnitDataResponse>('/syapi/Goods/getUnitData', { data });

// 获取附加费
export const getFujiafei = (data: FujiafeiParams) => post<FujiafeiResponse>('/syapi/Fujiafei/getFujiafeiData', { data });

// // 文件上传
export const uploadFile = (filePath: string) =>
  upload<any>('/syapi/upload/upload', { filePath, name: 'file' });
